#ifndef __MOOSE_DYNAMIC_LIB_H__
#define __MOOSE_DYNAMIC_LIB_H__

/* Define callback func */
typedef int (*fn_moose_dynamic_lib_load)(void* arg1, void* arg2);
typedef int (*fn_moose_dynamic_lib_start)(void* arg1, void* arg2);
typedef int (*fn_moose_dynamic_lib_unload)(void* arg1, void* arg2);
/* End Define callback func */

typedef struct moose_dynamic_lib_s {
    /* Must be full path */
    char*   filename;
    void*   handle;

    fn_moose_dynamic_lib_load fn_load;
    fn_moose_dynamic_lib_start fn_start;
    fn_moose_dynamic_lib_unload fn_unload;
}moose_dynamic_lib_s;

/* Must be full path */
moose_dynamic_lib_s* moose_dynamic_lib_load(const char* file, int len);
void moose_dynamic_lib_unload(moose_dynamic_lib_s* lib);

#endif
